import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
  title: '振昌的博客',
  tagline: '学习最好，最快的方式就是分享',
  favicon: 'img/favicon.ico',

  // Set the production url of your site here
  url: 'https://augustf.top',
  // Set the /<baseUrl>/ pathname under which your site is served
  // For GitHub pages deployment, it is often '/<projectName>/'
  baseUrl: '/',

  // GitHub pages deployment config.
  // If you aren't using GitHub pages, you don't need these.
  // organizationName: 'facebook', // Usually your GitHub org/user name.
  // projectName: 'docusaurus', // Usually your repo name.

  onBrokenLinks: 'throw',
  onBrokenMarkdownLinks: 'warn',

  // Even if you don't use internationalization, you can use this field to set
  // useful metadata like html lang. For example, if your site is Chinese, you
  // may want to replace "en" with "zh-Hans".
  i18n: {
    defaultLocale: 'zh',
    locales: ['zh'],
  },

  presets: [
    [
      'classic',
      {
        docs: {
          sidebarPath: './sidebars.ts',
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          // editUrl:
          //   'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
        },
        blog: false,
        /*blog: {
          showReadingTime: true,
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          // editUrl:
          //   'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
          blogSidebarTitle: '所有随笔',
          blogSidebarCount: 'ALL',
        },*/
        theme: {
          customCss: './src/css/custom.css',
        },
      } satisfies Preset.Options,
    ],
  ],

  themeConfig: {
    // Replace with your project's social card
    image: 'img/zhenchang-social-card.jpg',
    navbar: {
      title: '振昌的博客',
      hideOnScroll: true,
      logo: {
        alt: 'My Site Logo',
        src: 'img/logo.svg',
      },
      items: [
        {
          type: 'docSidebar',
          sidebarId: 'frontEnd',
          position: 'left',
          label: '前端框架',
        },
        {
          type: 'docSidebar',
          sidebarId: 'typeScript',
          position: 'left',
          label: 'TypeScript',
        },
        {
          type: 'docSidebar',
          sidebarId: 'software',
          position: 'left',
          label: '其他文章',
        },
        // {to: '/blog', label: '随笔', position: 'left'},
        {
          href: 'https://gitee.com/augustfeng/abesdocusa',
          label: 'Gitee',
          position: 'right',
        },
        {
          href: 'https://github.com/fengzhenchang',
          label: 'GitHub',
          position: 'right',
        },
      ],
    },
    footer: {
      style: 'dark',
      links: [
        {
          title: '文档',
          items: [
            {
              label: '前端框架',
              to: '/docs/frontEnd/welcome',
            },
            {
              label: '工具使用',
              to: '/docs/software/welcome',
            },
          ],
        },
        {
          title: '我的链接',
          items: [
            {
              label: 'CSDN',
              href: 'https://blog.csdn.net/fengzhenchang',
            },
            {
              label: 'bilibili',
              href: 'https://space.bilibili.com/34877676',
            },
          ],
        },
        {
          title: '更多',
          items: [
            {
              label: 'MDN Web Docs',
              href: 'https://developer.mozilla.org/zh-CN/',
            },
            {
              label: 'Can I use',
              href: 'https://caniuse.com/',
            },
          ],
        },
      ],
      copyright: `Copyright © ${new Date().getFullYear()} Zhenchang's Blog. Built with Docusaurus. Hosted by Cloudflare.`,
    },
    prism: {
      theme: prismThemes.github,
      darkTheme: prismThemes.dracula,
      additionalLanguages: ['powershell','json','bash'],
    },
  } satisfies Preset.ThemeConfig,
  markdown: {
    remarkRehypeOptions: {
      footnoteLabel:'脚注：',
    },
  },
};

export default config;
